View on GitHub

csc263

Notes for CSC263 - Data Structures and Analysis

Back to index

Balanced Binary Search Trees - AVL Trees

“Symmetry is reallly important to preserve laziness.”

​ - Danny Heap

Balance Factor

$height(v) = $ the length of the longest path from $v$ to a leaf ($height(empty\ tree) = -1$)

balance factor $BF(v) = height(v.right) - height(v.left)$

AVL Trees

(Adelson-Velski-Landis Trees)

An AVL tree $T$ is a BST where for every node $v \in T$, $-1 \leq BF(v) \leq 1$

Properties

Operations